//弹出信息窗口 title:标题 msgString:提示信息 msgType:信息类型 [error,info,question,warning]
function msgShow(title, msgString, msgType) {
	$.messager.alert(title, msgString, msgType);
}

/**
 * 警告
 * @param msg
 */
function warning(msg){
	msgShow("系统提示" , msg , "warning");
}

function errors(msg){
	msgShow("系统提示", "查找数据失败", "error");
}

function infos(msg){
	msgShow("系统提示" , msg , "info");
}

// 扩展 Jquery 获取表单对象
$.fn.serializeObject = function() {
	var o = {};
	var a = this.serializeArray();
	$.each(a, function() {
		if (o[this.name]) {
			if (!o[this.name].push) {
				o[this.name] = [ o[this.name] ];
			}
			o[this.name].push(this.value || '');
		} else {
			o[this.name] = this.value || '';
		}
	});
	return o;
}

Date.prototype.format = function(format) // author: meizz
{
	var o = {
		"M+" : this.getMonth() + 1, // month
		"d+" : this.getDate(), // day
		"h+" : this.getHours(), // hour
		"m+" : this.getMinutes(), // minute
		"s+" : this.getSeconds(), // second
		"q+" : Math.floor((this.getMonth() + 3) / 3), // quarter
		"S" : this.getMilliseconds()
	// millisecond
	}
	if (/(y+)/.test(format))
		format = format.replace(RegExp.$1, (this.getFullYear() + "")
				.substr(4 - RegExp.$1.length));
	for ( var k in o)
		if (new RegExp("(" + k + ")").test(format))
			format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k]
					: ("00" + o[k]).substr(("" + o[k]).length));
	return format;
}
/**
 * 返回系统当前日期 包含星期
 */
function getCurrentDateAndWeek(){
	var rtnValue = '';
	var today = new Date();
	var date  = today.getDate();
	var month = today.getMonth()+1;
	var year  = today.getYear()+1900;
	rtnValue = "今天是:"+year + "年"+month+"月"+date+"日 ";
	if (today.getDay() == 5) rtnValue += "星期五";
	if (today.getDay() == 6) rtnValue += "星期六";
	if (today.getDay() == 0) rtnValue += "星期日";
	if (today.getDay() == 1) rtnValue += "星期一";
	if (today.getDay() == 2) rtnValue += "星期二";
	if (today.getDay() == 3) rtnValue += "星期三";
	if (today.getDay() == 4) rtnValue += "星期四";
	return rtnValue;
}

function failed() {

}

function validator(val) {

}

function getPagination() {

	return '';
}